<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="./bootstrap-3.3.7/css/bootstrap.min.css">
    <link rel="stylesheet" href="./css/index.css">
    <script src="./js/jquery-3.3.1.min.js"></script>
    <script src="./bootstrap-3.3.7/js/bootstrap.js"></script>
    <title>小钱罐下载</title>
</head>
<body>
<div class="container back">
    <div class="col-md-12 col-xs-12 col-bg-12">
        <div class="marginimg">
            <img src="./img/share.png" alt="分享" class="img-responsive img">
        </div>
    <div class="marginimg">
        <button class="btn btn-default button" id="download">立即下载</button>
    </div>
    <div class="marginline">
        <div class="line"></div>
    </div>
    <div class="margin">
        <div class="text"><p>下载后记得填写我的邀请码领钱哦！</p></div>
    </div>
    <div class="margininvite">
        <div class="invite"><p id="invite">12345678</p></div>
    </div>
</div>
</div>
<script>
  $(document).ready(function(){
    var url = window.location.search;
    var invite = url.match(/^(\?t\=)(.+)$/)[2];
    $('#invite').html(invite);
    $('#download').click(function(){
        var ua = window.navigator.userAgent.toLowerCase();
        //微信
        if(ua.match(/MicroMessenger/i) == 'micromessenger'){
          window.location.href='downLoadForPhone';
        }else{//非微信浏览器
          if (navigator.userAgent.match(/(iPhone|iPod|iPad);?/i)) {
            var loadDateTime = new Date();
            window.setTimeout(function() {
              var timeOutDateTime = new Date();
              if (timeOutDateTime - loadDateTime < 5000) {
                window.location = "";//ios下载地址
              } else {
                window.close();
              }
            },2000);
            window.location = "schema://";
          }else if (navigator.userAgent.match(/android/i)) {
            var state = null;
            try {
              window.location = 'schema://';
              setTimeout(function(){
                window.location= "http://www.sitmei.com/app.v2.apk"; //android下载地址

              },500);
            } catch(e) {}
          }
        }
    });
  });
</script>
</body>
</html>